package priv.demos.demo1.solution.main;

import com.alibaba.fastjson.JSON;
import com.payment.lc.pcs.common.enums.FundType;

import java.util.HashMap;
import java.util.Map;

/**
 * Created on 2017/1/11.
 */
public class Main3 {

    public static void main(String[] args) {
        FundType[] values = FundType.values();
        HashMap<String, MoneyFundBean> ss = new HashMap<String, MoneyFundBean>();
        for (FundType fundType : values) {
            MoneyFundBean bean = new MoneyFundBean();
            bean.setText(fundType.getText());
            bean.setCode(fundType.getCode());
            ss.put(fundType.name(), bean);
        }
        System.out.println(JSON.toJSONString(ss));
    }

    private  class A{

        /**
         * MoneyFund : {"text":"货币基金","code":"MF"}
         * IndexFund : {"text":"指数基金","code":"IF"}
         * BondFund : {"text":"债券基金","code":"BF"}
         */

        private Map<String,MoneyFundBean> MoneyFund;

        public Map<String, MoneyFundBean> getMoneyFund() {
            return MoneyFund;
        }

        public void setMoneyFund(Map<String, MoneyFundBean> moneyFund) {
            MoneyFund = moneyFund;
        }
    }

    public static class MoneyFundBean {
        /**
         * text : 货币基金
         * code : MF
         */

        private String text;
        private String code;

        public String getText() {
            return text;
        }

        public void setText(String text) {
            this.text = text;
        }

        public String getCode() {
            return code;
        }

        public void setCode(String code) {
            this.code = code;
        }
    }
}